home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr52 / expand53.zip / XPDEMO.ZIP / XPDISK.PRG < prev    next >
Text File  |  1992-08-07  |  3KB  |  98 lines

  1. * ------------------------------------------------------------------------
  2. * Module......:    XPDISK.PRG
  3. * Title.......: DISK part of the Expand Library Demonstration Program
  4. * Author......:    Pepijn Smits.
  5. * Date........:    July/August 1992
  6. * Copyright...:    (c)1992 by Softwarebureau Pepijn Smits
  7. * Notes.......:    Clipper 5.01 Demo of the Expand Library
  8. *        Some general DISK functions
  9. *        See XPDEMO.RMK For Compile and Link instructions.
  10. * ------------------------------------------------------------------------
  11.  
  12. Function ChangeDrive()
  13. Local i
  14. Local DriveMenu := {}
  15. Local colon := if(XPlastDisk()<14,':','')
  16. For i := 0 to XPlastdisk()
  17.     aAdd(DriveMenu, if(i=XPgetDisk(),'~','')+Chr(65+i)+colon)
  18. Next
  19. i := XPalert('Select Drive','Select the New ~default~ drive',DriveMenu,XPgetDisk()+1)
  20. if i != 0
  21.    /* We're changing the Drive.. */
  22.    if XPDOSvalue() >= 3.20
  23.       /* Check for Logical drive acces if DOS 3.20 + */
  24.       if XPGetDrive(i) <> 0
  25.          if XPGetDrive(i) <> i
  26.             XPalert('Drive Select','Physical drive was not ~last~ accessed as this drive;'+;
  27.         'Enter Disk for Drive ~'+Chr(64+i)+':')
  28.         XPsetDrive(i)         /* Set the drive as Being last accessed */
  29.          end
  30.       end
  31.    end
  32.    XPsetDisk(i-1)            /* select Default Disk */
  33.    if XPgetDisk() <> i-1 
  34.       XPalert('Invalid Drive','Sorry, It seems that drive ~'+chr(64+i)+':~ is invalid..')
  35.    end
  36. end
  37. Return (NIL)
  38.  
  39. Function DiskStatus()
  40.  
  41. XPalert('Disk Status',;
  42.  PadR("Current drive      : ~" + Chr(XPgetDisk()+65)+':',60)+";"+;
  43.  PadR("Qualified Path     : ~" + XPqualify('.'),60)+";"+;
  44.  PadR("Free disk space    : ~" + Str(DiskSpace(),10)+" Bytes.",60)+";"+;
  45.  PadR("Total disk space   : ~" + Str(XPdiskTotal(),10)+" Bytes.",60)+";"+;
  46.  PadR("Disk Fixed?        : ~" + iif(XPdiskFixed(),'Yes.','No. '),60)+";"+;
  47.  PadR("Disk Remote?       : ~" + iif(XPdiskRemote(),'Yes.','No. '),60)+";"+;
  48.  PadR("Valid drives are   : ~A: - " + Chr( XPlastDisk() + 65 )+':',60)+";"+;
  49.  PadR("Used/Avail Handles : ~" + nTrim(XPgetHandles()) + "/" + nTrim(XPmaxHandles()),60))
  50.  
  51. Return (NIL)
  52.  
  53.  
  54. Function DirTree()
  55. Local aTree := {} 
  56. Local x, i := 1
  57.  
  58. XPpop(' ~Directory~ Tree',' ; Scanning the Disk For directories;;;;Please Wait..;')
  59.  
  60. i := 1
  61. XPdirTree("\",{|t,s|aAdd(aTree,'  '+t),XPcenter(XPmidRow(),nTrim(i++))})
  62.  
  63. XPmsg(' ~Dir~ Tree │ No directory change will take place, simply browse..')
  64. XPbrowse('  Directory ~Tree~ of Drive '+Chr(XPgetDisk()+65)+': ','  Graphical ~directory~ tree:',aTree)
  65.  
  66. Return (NIL)
  67.  
  68.  
  69. Function FileFind()
  70. Local cMask := Prompt("~File~ Find","Enter Mask of file(s) to find:","*.DBF")
  71. Local aFiles := {} 
  72. Local x, i := 1
  73.  
  74. XPpop(' ~File~ Find',' ; Scanning the Disk For Files matching ~'+cMask+'~;;0;;File(s) Found, Please Wait..(Scanning);')
  75.  
  76. i := 1
  77. XPfileFind("\",cMask,;
  78.     {|e|aAdd(aFiles,'  '+Padr(e[1],45)+' '+Str(e[2],9)+' '+DtoC(e[3])+' '+e[4]),;
  79.     XPcenter(XPmidRow(),nTrim(i++))})
  80.  
  81. XPmsg(' ~File~ Find │ Here are the Files Found....')
  82.  
  83. if Len(aFiles)>0
  84.     XPbrowse(' ~File~ Find ',;
  85.     '  File:                                        Size:      Date:    Time:',;
  86.     aFiles)
  87. else
  88.     XPalert('~File~ Find','Sorry, no files Found matching ~'+cMask+'~..')
  89. end
  90. Return (NIL)
  91.  
  92. Function TempFile()
  93. XPalert("Sorry",'The Routines for the ~TempFile~ testing have not yet been;written and tested..')
  94.  
  95. // Beta tester: Please try it in your Network if you can test them there....
  96.  
  97. Return (NIL)
  98.